package com.obas.event {

   import com.obas.model.DataRefreshHelper;

   import flash.events.Event;

   public class DataRefreshEvent extends Event {
      public static const REQUEST_ID:String = "DataRefreshEvent_Request";

      public static const TYPE_UPDATE:String = "updateData";
      public static const TYPE_ADD:String = "addData";
      public static const TYPE_DELETE:String = "deleteData";
      public static const TYPE_REFRESH:String = "refreshData";
      public static const TYPE_ADD_UPDATE:String = "addOrUpdateData";

      private var _spec:DataRefreshHelper;
      private var _actionType:String
      public function DataRefreshEvent(spec:DataRefreshHelper,
                                       actionType:String = TYPE_REFRESH,
                                       type:String = null) {
         var typeId:String = type;
         if (type == null) {
            typeId = REQUEST_ID;
         }
         super(typeId);
         _spec = spec;
         _actionType = actionType;
      }

      public override function clone():Event {
         var event:DataRefreshEvent = new DataRefreshEvent(spec, actionType, type);
         return event;
      }

      public function get spec():DataRefreshHelper {
         return _spec;
      }

      public function get actionType():String {
         return _actionType;
      }
   }
}